package v1

import (
	"gf-vben-admin/internal/model/system"
	"gf-vben-admin/internal/model/system/entity"
	"github.com/gogf/gf/v2/frame/g"
)

//PermissionPageListReq 分页查询API表Req
type PermissionPageListReq struct {
	g.Meta `path:"/pageList" tags:"Permission" method:"post" summary:"分页查询API表"`
	system.Permission
}

//PermissionPageListRes 分页查询API表Res
type PermissionPageListRes struct {
	Total int                  `json:"total" dc:"行数"`
	Rows  []*entity.Permission `json:"rows" dc:"API表数组"`
}

//PermissionListReq 列表查询API表Req
type PermissionListReq struct {
	g.Meta `path:"/list" tags:"Permission" method:"post" summary:"列表查询API表"`
	entity.Permission
}

//PermissionListRes 列表查询Res
type PermissionListRes struct {
	Rows []*entity.Permission `json:"rows" dc:"API表数组"`
}

// PermissionGetReq 查询API表详情Req
type PermissionGetReq struct {
	g.Meta `path:"/:id" tags:"Permission" method:"get" summary:"列表查询API表"`
	Id     int64 `json:"id" dc:""`
}

// PermissionGetRes 查询API表详情Res
type PermissionGetRes struct {
	*entity.Permission
}

//PermissionAddReq 添加API表Req
type PermissionAddReq struct {
	g.Meta      `path:"/" tags:"Permission" method:"post" summary:"添加API表"`
	TenantCode  string `json:"tenantCode"   dc:"租户编码"`                               //租户编码
	Code        string `json:"code" v:"required#权限的标识不能为空"  dc:"权限的标识"`              //权限的标识
	Path        string `json:"path"   dc:"权限对应的api路径"`                               //权限对应的api路径
	Method      string `json:"method" v:"required#请求的http方法不能为空"  dc:"请求的http方法"`    //请求的http方法
	Tag         string `json:"tag"   dc:"所属标签"`                                      //所属标签
	Description string `json:"description"   dc:"方法描述"`                              //方法描述
	State       int8   `json:"state" v:"required#状态（1正常 0停用）不能为空"  dc:"状态（1正常 0停用）"` //状态（1正常 0停用）
}

//PermissionAddRes 添加API表Req
type PermissionAddRes struct {
	Msg string `json:"msg" dc:"添加提示"`
}

//PermissionEditReq 编辑API表Req
type PermissionEditReq struct {
	g.Meta        `path:"/" tags:"Permission" method:"put" summary:"编辑API表"`
	Id            int64  `json:"id" v:"required#不能为空"  dc:""`                          //主键
	VersionNumber string `json:"versionNumber" v:"required#未识别到版本号" dc:"版本号"`          //版本号
	TenantCode    string `json:"tenantCode"   dc:"租户编码"`                               //租户编码
	Code          string `json:"code" v:"required#权限的标识不能为空"  dc:"权限的标识"`              //权限的标识
	Path          string `json:"path"   dc:"权限对应的api路径"`                               //权限对应的api路径
	Method        string `json:"method" v:"required#请求的http方法不能为空"  dc:"请求的http方法"`    //请求的http方法
	Tag           string `json:"tag"   dc:"所属标签"`                                      //所属标签
	Description   string `json:"description"   dc:"方法描述"`                              //方法描述
	State         int8   `json:"state" v:"required#状态（1正常 0停用）不能为空"  dc:"状态（1正常 0停用）"` //状态（1正常 0停用）
}

//PermissionEditRes 编辑API表Res
type PermissionEditRes struct {
	Msg string `json:"msg" dc:"编辑提示"`
}

//PermissionEditStateReq 编辑API表状态Req
type PermissionEditStateReq struct {
	g.Meta `path:"/state" tags:"Permission" method:"put" summary:"批量编辑API表状态"`
	Ids    []int64 `json:"ids" v:"required#字典主键不能为空"  dc:"id集合"`   //主键
	State  int8    `json:"state" v:"required#字典状态不能为空"  dc:"字典状态"` //状态
}

//PermissionDelReq 删除API表Req
type PermissionDelReq struct {
	g.Meta `path:"/" tags:"Permission" method:"delete" summary:"删除API表"`
	Ids    []int64 `json:"ids" v:"required#请选择需要删除的数据" dc:"id集合"`
}

//PermissionDelRes 删除API表Res
type PermissionDelRes struct {
	Msg string `json:"msg" dc:"删除提示"`
}
